< previous page page_646 next page >

Page 646
control to a data field. Close the Properties window. Notice that Title now appears on the text box.
Next, add two additional text fields named txtDesc and txtYear to the Detail section of the report using Description and Year Published for their DataField properties. Finally, resize the Detail section so that you don't have a lot of wasted space beneath the three text fields. The resulting form is pictured in Figure 29.3.
0646-01.jpg
Figure 29.3
Setting up a report field is as
easy as setting up a bound control.
Adding Header Information
The three text box controls you just added appear in the Detail section of the report; they therefore will display information from the database. However, you also should add some fixed information in the header of the report to label these fields. To do so, you can simply add RptLabel controls to the appropriate sections of the report and set their Caption properties.
rptlabel.gif For the sample report, add three labels to the Page Header section. Make their captions Title, Cost, and Year Published. Arrange each label so that it describes the field below it in the Detail section.
Next, add a fourth RptLabel control to the report in the Report Header section. This field will display the name of the person who created the report, which will be set from Visual Basic code. Because you need to access this label control from code, the names of the section and the label control should be set to something meaningful. To change the Name properties of these two objects, do the following:
1. Select the RptLabel control, and change its Name property to lblPerson just as you would with a standard Label control. Also, change the Caption property to an empty string.
2. Click the gray bar at the top of the Report Header section, and press F4 to display the Properties window for this section.
3. Change the Name property of the section to rptHeader.
After you finish these steps, your Data Report should look like Figure 29.4. You are now finished with the report design.

 
< previous page page_646 next page >